Skip to content

Fix for NpmVersionRange.from_native and README - #34

Merged
pombredanne merged 2 commits into
aboutcode-org:mainfrom
keshav-space:main
Feb 16, 2022
Merged

Fix for NpmVersionRange.from_native and README#34
pombredanne merged 2 commits into
aboutcode-org:mainfrom
keshav-space:main

Conversation

@keshav-space

@keshav-space keshav-space commented Jan 29, 2022

Copy link
Copy Markdown
Member

1. Fix README

  • Import versions instead version
     [❌] from univers.version import PypiVersion
     [✅] from univers.versions import PypiVersion
  • Use relative-path to execute configure script

2. Fix NpmVersionRange

  • NpmVersionRange.from_native was returning a tuple containing list of VersionConstraint

  • Instead it must return a tuple containing VersionConstraint

    • Earlier NpmVersionRange.from_native("^1.0.2") would return constraints as
      ([VersionConstraint(comparator='<', version=SemverVersion(string='2.0.0')), VersionConstraint(comparator='>=', version=SemverVersion(string='1.0.2'))],)
    • After Fix
      (VersionConstraint(comparator='>=', version=SemverVersion(string='1.0.2')), VersionConstraint(comparator='<', version=SemverVersion(string='2.0.0')))
  • Fixes: NpmVersionRange.from_native isn't returning constraints as intended #35

3. Add test for NpmVersionRange

  • test_NpmVersionRange_from_native_with_compatible_with_version_operator
  • test_NpmVersionRange_from_native_with_approximately_equal_to_operator

4. Don't do black codestyle test for docs and etc

Signed-off-by: keshav-space keshav6240@gmail.com

@keshav-space keshav-space changed the title Fix typos in Example and Deployment Fix NpmVersionRange.from_native and README Jan 30, 2022
@keshav-space keshav-space changed the title Fix NpmVersionRange.from_native and README Fix for NpmVersionRange.from_native and README Jan 30, 2022

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent catch!
Thanks... can you add a test or two?

@keshav-space

Copy link
Copy Markdown
Member Author

Excellent catch! Thanks... can you add a test or two?

Done !!

@Hritik14

Hritik14 commented Feb 7, 2022

Copy link
Copy Markdown
Collaborator

@keshav-space codestyle tests are failing. Please run python -m black -l 100 setup.py etc src tests docs to fix this.

@Hritik14 Hritik14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice catch! I've added some suggestions for you to consider

Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py

@Hritik14 Hritik14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few changes to go

Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py Outdated
Comment thread tests/test_version_range.py Outdated
@Hritik14

Copy link
Copy Markdown
Collaborator

@keshav-space LGTM!
Please squash your commits in two parts - black formatting and the fix.

README:
- Import `versions` instead of `version`
- Use relative path to execute `configure` script

version_range:
- `NpmVersionRange.form_native` should generate tuple of `VersionConstraint`
- Fixes: aboutcode-org#35

test_version_range:
- Add test for NpmVersionRange.from_native

Signed-off-by: keshav-space <keshav6240@gmail.com>
@keshav-space
keshav-space force-pushed the main branch 2 times, most recently from 1e46e46 to fd9d341 Compare February 15, 2022 13:25
- codestyle test for `etc`, will be handled by `skeleton`
- see: aboutcode-org/skeleton#54

Signed-off-by: keshav-space <keshav6240@gmail.com>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!
Merging!

@pombredanne
pombredanne merged commit 73ff686 into aboutcode-org:main Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NpmVersionRange.from_native isn't returning constraints as intended

3 participants